{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "surrounded-fashion",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jupyter environment detected. Enabling Open3D WebVisualizer.\n",
      "[Open3D INFO] WebRTC GUI backend enabled.\n",
      "[Open3D INFO] WebRTCWindowSystem: HTTP handshake server disabled.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "import numpy as np\n",
    "from kyle_robot_toolbox.robot_arm.arm5dof_uservo import Arm5DoFUServo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "selective-monster",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建机械臂\n",
    "arm = Arm5DoFUServo(config_folder=\"./config\", \\\n",
    "                    is_init_pose=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "brilliant-characterization",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 设置爪子的弧度\n",
    "arm.set_gripper_angle(math.radians(30), T=0.25, max_power=1000) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "functional-carnival",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 设置爪子的弧度\n",
    "arm.set_gripper_angle(math.radians(0), T=0.25, max_power=1000) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "accompanied-sarah",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 爪子开启\n",
    "arm.gripper_open()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "sized-april",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 爪子闭合\n",
    "arm.gripper_close()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
